package com.gds.wiki.cloud.admin.server.modular.sys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gds.wiki.cloud.admin.client.sys.model.Dept;
import com.gds.wiki.cloud.admin.client.sys.model.query.DeptQuery;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @Author:wiki
 * @Date:Create in 2018/7/20 0020 上午 10:30
 */
public interface DeptMapper extends BaseMapper<Dept> {

   @Select("select id from sys_dept where pids like CONCAT('%[',#{pid},']%') or id=#{pid")
   List<Long> deptIdsByPid(Map map);


    List<Dept> treeByPid(@Param("deptQuery") DeptQuery deptQuery);
}
